fix(scheduler): prune printedLog when a node is deleted - #2939
fix(scheduler): prune printedLog when a node is deleted#2939im-Toqeer-506 wants to merge 1 commit into
Conversation
Signed-off-by: M Toqeer Zia <muhammadtoqeerzia586694@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: im-Toqeer-506 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe scheduler now owns the node printed-log map, removes entries during node cleanup, and uses a single-argument ChangesPrinted log lifecycle
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change prunes deleted-node log state and restores correct logging when a node is recreated; no actionable merge-blocking risk remains. Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What type of PR is this?
/kind bug
What this PR does / why we need it:
printedLogwas a loop-local map inRegisterFromNodeAnnotations, soonDelNodecould not remove entries from it.This caused two issues:
Node device updatedatV(5)instead ofNode device addedat info level. This meant the replacement node was not visible in default-verbosity logs.This PR moves
printedLogintoSchedulerstate and protects it with the existings.lock. Entries are removed incleanupNodeUsage, which already handles per-node cleanup duringonDelNode.Which issue(s) this PR fixes:
Fixes #2937
Validation:
Test_register_PrintedLogPrunedOnNodeDeletecovering add → delete → re-add and ensuring other nodes remain in the map.Test_register_NodeCacheConcurrencyalready tests concurrentregister()andonDelNode()calls. It passes with-race.-short --race -count=1— 38 packages pass.golangci-lintv2.13.1 — 0 issues.gofmt,goimports, and license checks pass.TestPrepareHostPIDLockParentstill fails in my environment, but the same failure occurs on a cleanupstream/master, so it is pre-existing and unrelated to this PR.Does this PR introduce a user-facing change?
AI assistance disclosure: AI was used to assist with the analysis, implementation, and tests. I reviewed the changes and verified the results.
Summary by CodeRabbit